package com.bobo.web.provider.service.impl;

import com.bobo.web.api.annotation.Master;
import com.bobo.web.api.domain.game.PlayPlanDO;
import com.bobo.web.api.vo.base.ResponseResult;
import com.bobo.web.provider.dao.game.PlayPlanMapper;
import com.bobo.web.provider.service.PlanPlayService;
import com.bobo.web.provider.util.commutils.GeneralNumUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class PlanPlayServiceImpl implements PlanPlayService {
    @Resource
    private PlayPlanMapper playPlanMapper;

    @Override
    public ResponseResult<PlayPlanDO> selectPlayPlanByPrimaryKey(Integer id) {
        PlayPlanDO playPlanDO = playPlanMapper.selectPlayPlanByPrimaryKey(id);
        return ResponseResult.success(playPlanDO);
    }

    @Master
    @Override
    public ResponseResult<Integer> insertPlayPlanSelective(PlayPlanDO record) {
        record.setPlanId(GeneralNumUtil.getGeneralNum("P"));
        int i = playPlanMapper.insertPlayPlanSelective(record);
        return ResponseResult.success(i);
    }

    @Master
    @Override
    public ResponseResult<Integer> updatePlayPlanSelective(PlayPlanDO record) {
        int i = playPlanMapper.updatePlayPlanByPlanIdSelective(record);
        return ResponseResult.success(i);
    }
}
